home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / cfortune.zip / MAKEFILE < prev    next >
Text File  |  1989-05-25  |  4KB  |  163 lines

  1.  
  2. OWNER    = daemon
  3.  
  4. CC     = cc
  5. DEFS   =
  6. CFLAGS = ${DEFS} -O
  7. FFLAGS = ${DEFS}
  8. PFLAGS = ${DEFS}
  9. LFLAGS = 
  10. YFLAGS = 
  11. LDFLAGS= 
  12. LIBS   = 
  13. SFLAGS=        -r
  14. TDEV=        -Pver
  15. TROFF=        ditroff $(TDEV)
  16.  
  17. DESTBIN= /usr/games
  18. DESTETC= /etc
  19. DESTLIB= /usr/games/lib
  20. MS     = l
  21. MANDIR = /usr/man/man${MS}
  22. CATDIR = /usr/man/cat${MS}
  23.  
  24. HDRS   = strfile.h 
  25. SRCS   = fortune.c strfile.c unstr.c yow.c
  26. OBJS   = fortune.o strfile.o unstr.o yow.o
  27. FORTUNES= cooday.src coojar.src cookmm.src coomit.src coonyt.src \
  28.     coosma.src croll.src mayyou.src zippy.src obscene \
  29.     rules.src scene
  30. OTHERS = ${FORTUNES} Makefile fortune.6
  31. VERS   = 
  32.  
  33. .DEFAULT:
  34.     co $<
  35.  
  36. all:    fortune strfile unstr fortunes.dat zippy.dat yow
  37.  
  38. fortune: fortune.o rnd.o
  39.     $(CC) $(CFLAGS) -o fortune fortune.o rnd.o
  40.  
  41. yow: yow.o rnd.o
  42.     $(CC) $(CFLAGS) -o yow yow.o rnd.o
  43.  
  44. strfile: strfile.o rnd.o
  45.     $(CC) $(CFLAGS) -o strfile strfile.o rnd.o
  46.  
  47. unstr: unstr.o
  48.     $(CC) $(CFLAGS) -o unstr unstr.o
  49.  
  50. fortune.o strfile.o unstr.o: strfile.h
  51.  
  52. fortunes.dat: fortunes strfile
  53.     ./strfile $(SFLAGS) fortunes
  54.  
  55. zippy.dat:    zippy.src strfile
  56.     ./strfile $(SFLAGS) zippy.src zippy.dat
  57.  
  58. fortunes:    ${FORTUNES}
  59.     cat cooday.src coojar.src cookmm.src coomit.src coonyt.src \
  60.         coosma.src croll.src mayyou.src zippy.src rules.src \
  61.         scene > fortunes
  62.     echo "%-" >> fortunes
  63.     cat obscene >> fortunes
  64.     echo "%%" >> fortunes
  65.  
  66. install:    all
  67.     install -m 600 -o ${OWNER} fortunes.dat ${DESTLIB}
  68.     install -s -m 4511 -o ${OWNER} fortune ${DESTBIN}
  69.     install -m 600 -o ${OWNER} zippy.dat ${DESTLIB}
  70.     install -s -m 4511 -o ${OWNER} yow ${DESTBIN}
  71. #    cp fortune.6 ${MANDIR}/fortune.${MS}
  72.     cp yow.6 ${MANDIR}/yow.${MS}
  73.  
  74. uninstall:    /tmp
  75.     rm -f ${DESTBIN}/fortune ${DESTLIB}/fortunes.dat \
  76.         ${MANDIR}/fortune.${MS} ${CATDIR}/fortune.${MS} \
  77.         ${DESTBIN}/yow ${DESTLIB}/zippy.dat \
  78.         ${MANDIR}/yow.${MS} ${CATDIR}/yow.${MS}
  79.  
  80. lint:    ${HDRS} ${SRCS}
  81.     lint -habx ${DEFS} ${SRCS}
  82.  
  83. shar:    ${HDRS} ${SRCS} ${OTHERS}
  84.     shar ${HDRS} ${SRCS} ${OTHERS} > fortune.shar
  85.  
  86. tags:    ${HDRS} ${SRCS}
  87.     ctags ${HDRS} ${SRCS}
  88.  
  89. clean:
  90.     @echo "Removing object and junk files."
  91.     rm -f fortune fortunes fortunes.dat fortunes.tar strfile unstr \
  92.         *.o core a.out make.log lint.out Makefile.bak fortune.shar
  93.  
  94. clobber:
  95.     @echo "Removing read-only source files that have RCS parents."
  96.     @echo "Error code 1 indicates last file in SRCS list was not removed."
  97.     @echo "(Which is OK)"
  98.     make clean
  99.     -if [ `whoami` != root ]; then \
  100.        for i in ${HDRS} ${SRCS}; do \
  101.           if [ ! -w $$i ]; then \
  102.              ( if   [ -f $$i,v ];     then rm -f $$i; \
  103.                elif [ -f RCS/$$i,v ]; then rm -f $$i; \
  104.              fi ); \
  105.           else echo $$i "writeable, not removed"; \
  106.           fi; \
  107.        done; \
  108.     else echo "Running \"make clobber\" as root will zap ALL SRCS,\
  109.         RCS'ed or not (not done)."; \
  110.     fi
  111.  
  112. compress:
  113.     make clean
  114.     @echo "Compressing source and RCS files."
  115.     find . -size +2 \( -name \*.h -o -name \*.c -o -name \*.f \
  116.         -o -name \*.p -o -name \*.l -o -name \*.y -o -name \*,v \
  117.         -o -name \*.src \) \
  118.         -exec compress {} \;
  119.  
  120. uncompress:
  121.     uncompressdir .
  122.  
  123. # RCS stuff
  124.  
  125. ci:        ${HDRS} ${SRCS}
  126.         -ci $?
  127.         @touch ci
  128.  
  129. coall:
  130.         co -l ${HDRS} ${SRCS}
  131.  
  132. update:
  133.         ci -sDist -u -f${VERS} ${HDRS} ${SRCS}
  134.         @touch ci
  135.  
  136. depend:
  137.     grep '^#[     ]*include' /dev/null ${SRCS} \
  138.         | sed -e '/"/s/:[^"]*"\([^"]*\)".*/: \1/' \
  139.               -e '/</s/:[^<]*<\([^>]*\)>.*/: \/usr\/include\/\1/' \
  140.         | sed 's/\.c/.o/' >makedep
  141.     echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  142.     echo '$$r makedep' >>eddep
  143.     echo 'w' >>eddep
  144.     cp Makefile Makefile.bak
  145.     ed - Makefile < eddep
  146.     rm eddep makedep
  147.     echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  148.     echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  149.     echo '# see make depend above' >> Makefile
  150.  
  151. # DO NOT DELETE THIS LINE -- make depend uses it
  152.  
  153. fortune.o: /usr/include/sys/types.h
  154. fortune.o: /usr/include/stdio.h
  155. fortune.o: strfile.h
  156. strfile.o: /usr/include/stdio.h
  157. strfile.o: strfile.h
  158. unstr.o: /usr/include/stdio.h
  159. unstr.o: strfile.h
  160. # DEPENDENCIES MUST END AT END OF FILE
  161. # IF YOU PUT STUFF HERE IT WILL GO AWAY
  162. # see make depend above
  163.